home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------------------------------------;
- ; Initialize the 8530 ;
- ; ;
- ; Copyright 1986, 1987 by H. Roy Engehausen. All rights reserved. ;
- ; This software may be freely distributed and used, but it may not ;
- ; under any circumstances be sold by anyone other than the author. ;
- ; It may be distributed by a commercial company as long as it is ;
- ; for no cost. ;
- ; ;
- ; Permission is explicity granted to use this code as a model for ;
- ; other programs requiring interrupt driven serial I/O as long as they ;
- ; carry this copyright notice and the imbedded constants ;
- ; ;
- ;--------------------------------------------------------------------------;
-
- CMP chip[SI],chip_8530 ; Is this an 8530?
- JNE init_not_8530 ; Nope: skip this
-
- MOV need_tmr,1 ; 8530 requires timer snatch
-
- MOV DX,baseaddr[SI] ; Get base address for chip
- MOV AL,sccreg9 ; Point at WR9
- OUT DX,AL ;
- MOV AL,sccreset ; Hardware reset the whole chip!
- OUT DX,AL ;
-
- MOV AL,sccreg1 ; Now to WR1
- OUT DX,AL ;
- SUB AL,AL ; Disable all interrupts!
- OUT DX,AL ;
-
- MOV AL,sccreg15 ; Now to WR15
- OUT DX,AL ;
- SUB AL,AL ; Disable all interrupts!
- OUT DX,AL ;
-
- MOV AL,sccreg2 ; Now to WR2
- OUT DX,AL ;
- SUB AL,AL ; Set vector
- OUT DX,AL ;
-
- init_not_8530: ; Not 8530 come here!